package labuda;

/**
 * @author Leonid Bushuev from JetBrains
 */
public class MiniTest
{

    public void testAlwaysOk()
    {
        sleep(1000);
        // do nothing!
    }


    public void testGetLargeArray025G()
    {
        System.gc();
        long[] array = null;
        int size = 256 * 1024 * 128;
        array = new long[size];
        array[size-1] = Long.MAX_VALUE;
        System.gc();
    }

    public void testGetLargeArray05G()
    {
        System.gc();
        long[] array = null;
        int size = 512 * 1024 * 128;
        array = new long[size];
        array[size-1] = Long.MAX_VALUE;
        System.gc();
    }

    public void testGetLargeArray1G()
    {
        System.gc();
        long[] array = null;
        int size = 1 * 1024 * 1024 * 128;
        array = new long[size];
        array[size-1] = Long.MAX_VALUE;
        System.gc();
    }

    //public void testGetLargeArray2G()
    //{
    //    System.gc();
    //    long[] array = null;
    //    int size = 2 * 1024 * 1024 * 128;
    //    array = new long[size];
    //    array[size-1] = Long.MAX_VALUE;
    //    System.gc();
    //}


    private void sleep(final int millis) {
        try {
            Thread.sleep(millis);
        }
        catch (InterruptedException e) {
        }
    }


}
